from time import sleep

import yaml
from selenium import webdriver


def test_get_cookie():
    driver = webdriver.Chrome()
    driver.get("https://work.weixin.qq.com/wework_admin/frame#index")
    # 人工扫码
    sleep(30)
    cookies = driver.get_cookies()
    with open('../datas/cookies.yaml', 'w') as f:
        yaml.safe_dump(cookies, f)
